package com.aaronprj.school.mbooks.resource;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.aaronprj.common.enums.UserRole;
import com.aaronprj.common.enums.mbooks.ItemCategory;
import com.aaronprj.common.web.resource.ResourceServices;
import com.aaronprj.school.mbooks.uivo.UISetting;

@Path("/setting")
public class SettingResource extends ResourceServices{

    @GET 
	@Produces(MediaType.APPLICATION_JSON)
    public String getSettings() {
    	UISetting uisetting = generateResult(UISetting.class, true, "", "");
    	uisetting.setItemCategory(ItemCategory.getEntities());
    	uisetting.setUserRole(UserRole.getEntities());
    	
    	return this.writeValueAsString(uisetting);
    }
	
    
	@Path("/itemcategory")
    @GET 
	@Produces(MediaType.APPLICATION_JSON)
    public String getItemCategory() {
    	return this.writeValueAsString(ItemCategory.getEntities());
    }


	@Path("/userrole")
    @GET 
	@Produces(MediaType.APPLICATION_JSON)
    public String getUserRole() {
    	return this.writeValueAsString(UserRole.getEntities());
    }
	


}
